package com.aegis.core.model;

import com.aegis.core.enums.AegisHttpMethod;

import java.util.Objects;

/**
 * @Author wuweixin
 *
 * @Version 1.0
 * @Descritube
 */
public class AegisUserApi {

    private String api;

    private String name;

    /**
     * 接口方法：大小写GET、POST、PUT等HTTP方法，null则全方法匹配
     */
    private AegisHttpMethod method;

    public AegisHttpMethod getMethod() {
        return method;
    }

    public void setMethod(AegisHttpMethod method) {
        this.method = method;
    }

    public String getApi() {
        return api;
    }

    public void setApi(String api) {
        this.api = api;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof AegisUserApi)) return false;
        AegisUserApi that = (AegisUserApi) o;
        return Objects.equals(api, that.api) &&
                Objects.equals(method, that.method);
    }

    @Override
    public int hashCode() {
        return Objects.hash(api, method);
    }
}
